package com.originskyseed.platform.user.service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.originskyseed.platform.core.base.BasePage;
import com.originskyseed.platform.user.model.PlayerRelateRecharge;

/**
 * 玩家充值信息表Service接口类（OSI_PLAYER_RELATE_RECHARGE）
 *
 * @author wlj
 */
public interface IPlayerRelateRechargeService {

	/**
	 * 删除记录
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKey(String id) throws Exception;

	/**
	 * 批量删除记录
	 *
	 * @param ids
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKeys(List<String> ids) throws Exception;

	/**
	 * 插入记录
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insert(PlayerRelateRecharge record) throws Exception;

	/**
	 * 插入记录（仅非空值字段）
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insertSelective(PlayerRelateRecharge record) throws Exception;

	/**
	 * 更新记录
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKey(PlayerRelateRecharge record) throws Exception;

	/**
	 * 更新记录（仅非空值字段）
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKeySelective(PlayerRelateRecharge record) throws Exception;

	/**
	 * 查询记录
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public PlayerRelateRecharge selectByPrimaryKey(String id) throws Exception;

	/**
	 * 查询列表
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public List<PlayerRelateRecharge> selectList(PlayerRelateRecharge record) throws Exception;

	/**
	 * 分页查询列表
	 *
	 * @param params
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public BasePage<PlayerRelateRecharge> selectListByPage(Map<String, Object> params, BasePage<PlayerRelateRecharge> page) throws Exception;



	/**
	 * 分页查询列表
	 * @param tenantCode
	 * @param params
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public BasePage<PlayerRelateRecharge> selectListByPageByTenantCode(String tenantCode,Map<String, Object> params, BasePage<PlayerRelateRecharge> page) throws Exception;


	/**
	 * 推广平台_业务员_查看玩家充值记录分页查询列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public BasePage<PlayerRelateRecharge> selectPlayerRelateRechargeListToSalesman(Map<String, Object> params, BasePage<PlayerRelateRecharge> page) throws Exception;

	/**
	 * 推广平台_业务员_查看玩家充值记录Excel导出
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<PlayerRelateRecharge> PlayerRelateRechargeListToSalesman(Map<String, Object> params) throws Exception;

	/**
	 * 推广平台_结算报表统计
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public BasePage<PlayerRelateRecharge> finacialSettlementToMonth(Map<String, Object> params, BasePage<PlayerRelateRecharge> page) throws Exception;

	/**
	 * 推广平台_结算报表统计_导出结算函
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<PlayerRelateRecharge> finacialSettlementLetter(Map<String, Object> params) throws Exception;

	/**
	 * 推广平台_收入对账表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public BasePage<PlayerRelateRecharge> selectRevenueReconcliationList(Map<String, Object> params, BasePage<PlayerRelateRecharge> page) throws Exception;

	/**
	 * 推广平台_收入对账表导出Excel
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<PlayerRelateRecharge> selectRevenueReconcliationListToExcel(Map<String, Object> params) throws Exception;

	/**
	 * 批量插入记录
	 *
	 * @param list
	 * @return
	 * @throws Exception
	 */
	public int insertBatch(List<PlayerRelateRecharge> list) throws Exception;


	/**
	 * 批量插入记录
	 *
	 * @param list
	 * @return
	 * @throws Exception
	 */
	public int insertBatch(String tenantCode,List<PlayerRelateRecharge> list) throws Exception;

	/**
	 * 批量插入记录,月表
	 *
	 * @param list
	 * @return
	 * @throws Exception
	 */
	public int insertMonthBatch(List<PlayerRelateRecharge> list) throws Exception;


	/**
	 * 批量插入记录,月表
	 *
	 * @param list
	 * @return
	 * @throws Exception
	 */
	public int insertMonthBatch(String tenantCode,List<PlayerRelateRecharge> list) throws Exception;

	/**
	 * 用户累计充值金额
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public BigDecimal totalAmount(@Param("id") String id) throws Exception;

	/**
	 * 充值列表统计充值金额
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public BigDecimal selectTotalAmountByMap(Map<String, Object> params) throws Exception;

	/**
	 * 分页查询支付明细列表
	 *
	 * @param params
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public BasePage<PlayerRelateRecharge> selectPaymentDetailsByPage(Map<String, Object> params, BasePage<PlayerRelateRecharge> page) throws Exception;

	/**
	 * 查询支付明细列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<PlayerRelateRecharge> selectPaymentDetailsByMap(Map<String, Object> params) throws Exception;

	/**
	 * 查询orderId是否存在
	 * 
	 * @param list
	 * @return
	 * @throws Exception
	 */
	public List<String> selectOrderIds(String tenantCode,List<String> list) throws Exception;



	/**
	 * 查询orderId是否存在
	 *
	 * @param list
	 * @return
	 * @throws Exception
	 */
	public List<String> selectOrderIds(List<String> list) throws Exception;
	/**
	 * 统计业务员累充类型
	 * 
	 * @param tenantCode
	 * @return
	 * @throws Exception
	 */
	public int insertUserCumulativeRechargeCount(String tenantCode) throws Exception;

	/**
	 * 查询内容平台导出
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<PlayerRelateRecharge> selectContentExcel(Map<String, Object> params) throws Exception;


	/**
	 * 查询累充金额，根据玩家id和时间
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public BigDecimal selectTotalAmountByPlayerIdAndTime(Map<String, Object> params) throws Exception;


	/**
	 * 查询上一次的累充金额
	 *
	 * @param playerId
	 * @return
	 * @throws Exception
	 */
	public BigDecimal selectAmountByPlayerId(String tenantCode,String playerId) throws Exception;


	/**
	 * 查询上一次的累充金额
	 *
	 * @param playerId
	 * @return
	 * @throws Exception
	 */
	public BigDecimal selectAmountByPlayerId(String playerId) throws Exception;
}
